3.1.35 \(\int (f+g x)^4 (a+b \log (c (d+e x)^n)) \, dx\) [35]

Optimal. Leaf size=178 \[ -\frac {b (e f-d g)^4 n x}{5 e^4}-\frac {b (e f-d g)^3 n (f+g x)^2}{10 e^3 g}-\frac {b (e f-d g)^2 n (f+g x)^3}{15 e^2 g}-\frac {b (e f-d g) n (f+g x)^4}{20 e g}-\frac {b n (f+g x)^5}{25 g}-\frac {b (e f-d g)^5 n \log (d+e x)}{5 e^5 g}+\frac {(f+g x)^5 \left (a+b \log \left (c (d+e x)^n\right )\right )}{5 g} \]

[Out]

-1/5*b*(-d*g+e*f)^4*n*x/e^4-1/10*b*(-d*g+e*f)^3*n*(g*x+f)^2/e^3/g-1/15*b*(-d*g+e*f)^2*n*(g*x+f)^3/e^2/g-1/20*b
*(-d*g+e*f)*n*(g*x+f)^4/e/g-1/25*b*n*(g*x+f)^5/g-1/5*b*(-d*g+e*f)^5*n*ln(e*x+d)/e^5/g+1/5*(g*x+f)^5*(a+b*ln(c*
(e*x+d)^n))/g

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 178, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {2442, 45} \begin {gather*} \frac {(f+g x)^5 \left (a+b \log \left (c (d+e x)^n\right )\right )}{5 g}-\frac {b n (e f-d g)^5 \log (d+e x)}{5 e^5 g}-\frac {b n x (e f-d g)^4}{5 e^4}-\frac {b n (f+g x)^2 (e f-d g)^3}{10 e^3 g}-\frac {b n (f+g x)^3 (e f-d g)^2}{15 e^2 g}-\frac {b n (f+g x)^4 (e f-d g)}{20 e g}-\frac {b n (f+g x)^5}{25 g} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(f + g*x)^4*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

-1/5*(b*(e*f - d*g)^4*n*x)/e^4 - (b*(e*f - d*g)^3*n*(f + g*x)^2)/(10*e^3*g) - (b*(e*f - d*g)^2*n*(f + g*x)^3)/
(15*e^2*g) - (b*(e*f - d*g)*n*(f + g*x)^4)/(20*e*g) - (b*n*(f + g*x)^5)/(25*g) - (b*(e*f - d*g)^5*n*Log[d + e*
x])/(5*e^5*g) + ((f + g*x)^5*(a + b*Log[c*(d + e*x)^n]))/(5*g)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rubi steps

\begin {align*} \int (f+g x)^4 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx &=\frac {(f+g x)^5 \left (a+b \log \left (c (d+e x)^n\right )\right )}{5 g}-\frac {(b e n) \int \frac {(f+g x)^5}{d+e x} \, dx}{5 g}\\ &=\frac {(f+g x)^5 \left (a+b \log \left (c (d+e x)^n\right )\right )}{5 g}-\frac {(b e n) \int \left (\frac {g (e f-d g)^4}{e^5}+\frac {(e f-d g)^5}{e^5 (d+e x)}+\frac {g (e f-d g)^3 (f+g x)}{e^4}+\frac {g (e f-d g)^2 (f+g x)^2}{e^3}+\frac {g (e f-d g) (f+g x)^3}{e^2}+\frac {g (f+g x)^4}{e}\right ) \, dx}{5 g}\\ &=-\frac {b (e f-d g)^4 n x}{5 e^4}-\frac {b (e f-d g)^3 n (f+g x)^2}{10 e^3 g}-\frac {b (e f-d g)^2 n (f+g x)^3}{15 e^2 g}-\frac {b (e f-d g) n (f+g x)^4}{20 e g}-\frac {b n (f+g x)^5}{25 g}-\frac {b (e f-d g)^5 n \log (d+e x)}{5 e^5 g}+\frac {(f+g x)^5 \left (a+b \log \left (c (d+e x)^n\right )\right )}{5 g}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.21, size = 315, normalized size = 1.77 \begin {gather*} \frac {e x \left (60 a e^4 \left (5 f^4+10 f^3 g x+10 f^2 g^2 x^2+5 f g^3 x^3+g^4 x^4\right )-b n \left (60 d^4 g^4-30 d^3 e g^3 (10 f+g x)+10 d^2 e^2 g^2 \left (60 f^2+15 f g x+2 g^2 x^2\right )-5 d e^3 g \left (120 f^3+60 f^2 g x+20 f g^2 x^2+3 g^3 x^3\right )+e^4 \left (300 f^4+300 f^3 g x+200 f^2 g^2 x^2+75 f g^3 x^3+12 g^4 x^4\right )\right )\right )+60 b d^2 g \left (-10 e^3 f^3+10 d e^2 f^2 g-5 d^2 e f g^2+d^3 g^3\right ) n \log (d+e x)+60 b e^4 \left (5 d f^4+e x \left (5 f^4+10 f^3 g x+10 f^2 g^2 x^2+5 f g^3 x^3+g^4 x^4\right )\right ) \log \left (c (d+e x)^n\right )}{300 e^5} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(f + g*x)^4*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

(e*x*(60*a*e^4*(5*f^4 + 10*f^3*g*x + 10*f^2*g^2*x^2 + 5*f*g^3*x^3 + g^4*x^4) - b*n*(60*d^4*g^4 - 30*d^3*e*g^3*
(10*f + g*x) + 10*d^2*e^2*g^2*(60*f^2 + 15*f*g*x + 2*g^2*x^2) - 5*d*e^3*g*(120*f^3 + 60*f^2*g*x + 20*f*g^2*x^2
 + 3*g^3*x^3) + e^4*(300*f^4 + 300*f^3*g*x + 200*f^2*g^2*x^2 + 75*f*g^3*x^3 + 12*g^4*x^4))) + 60*b*d^2*g*(-10*
e^3*f^3 + 10*d*e^2*f^2*g - 5*d^2*e*f*g^2 + d^3*g^3)*n*Log[d + e*x] + 60*b*e^4*(5*d*f^4 + e*x*(5*f^4 + 10*f^3*g
*x + 10*f^2*g^2*x^2 + 5*f*g^3*x^3 + g^4*x^4))*Log[c*(d + e*x)^n])/(300*e^5)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.41, size = 1105, normalized size = 6.21

method result size
risch \(\text {Expression too large to display}\) \(1105\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x+f)^4*(a+b*ln(c*(e*x+d)^n)),x,method=_RETURNVERBOSE)

[Out]

-b*f^4*n*x-1/2*I*g^3*Pi*b*f*x^4*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-I*g^2*Pi*b*f^2*x^3*csgn(I*c)*c
sgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-I*g*Pi*b*f^3*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)+1/5*(g*x
+f)^5*b/g*ln((e*x+d)^n)+b*f^4/e*n*d*ln(e*x+d)+1/5/e^5*g^4*ln(e*x+d)*b*d^5*n-1/10*I*g^4*Pi*b*x^5*csgn(I*c*(e*x+
d)^n)^3-1/2*I*Pi*b*f^4*x*csgn(I*c*(e*x+d)^n)^3+1/5*a*g^4*x^5+x*a*f^4+1/3/e*g^3*b*d*f*n*x^3-1/2/e^2*g^3*b*d^2*f
*n*x^2+1/e*g^2*b*d*f^2*n*x^2+1/e^3*g^3*b*d^3*f*n*x-2/e^2*g^2*b*d^2*f^2*n*x+2/e*g*b*d*f^3*n*x-2/e^2*g*ln(e*x+d)
*b*d^2*f^3*n-1/e^4*g^3*ln(e*x+d)*b*d^4*f*n+2/e^3*g^2*ln(e*x+d)*b*d^3*f^2*n+1/2*I*Pi*b*f^4*x*csgn(I*(e*x+d)^n)*
csgn(I*c*(e*x+d)^n)^2+1/2*I*Pi*b*f^4*x*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2+1/10*I*g^4*Pi*b*x^5*csgn(I*(e*x+d)^n)*c
sgn(I*c*(e*x+d)^n)^2-1/2*I*g^3*Pi*b*f*x^4*csgn(I*c*(e*x+d)^n)^3+I*g*Pi*b*f^3*x^2*csgn(I*(e*x+d)^n)*csgn(I*c*(e
*x+d)^n)^2+I*g^2*Pi*b*f^2*x^3*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2+I*g*Pi*b*f^3*x^2*csgn(I*c)*csgn(I*c*(e*x
+d)^n)^2+1/2*I*g^3*Pi*b*f*x^4*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2-1/10*I*g^4*Pi*b*x^5*csgn(I*c)*csgn(I*(e*
x+d)^n)*csgn(I*c*(e*x+d)^n)+1/2*I*g^3*Pi*b*f*x^4*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2-1/2*I*Pi*b*f^4*x*csgn(I*c)*cs
gn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-1/25*g^4*b*n*x^5+g^3*a*f*x^4+2*g^2*a*f^2*x^3+2*g*a*f^3*x^2+g^3*ln(c)*b*f*x
^4+2*g^2*ln(c)*b*f^2*x^3+2*g*ln(c)*b*f^3*x^2-1/5/g*ln(e*x+d)*b*f^5*n+I*g^2*Pi*b*f^2*x^3*csgn(I*c)*csgn(I*c*(e*
x+d)^n)^2-I*g^2*Pi*b*f^2*x^3*csgn(I*c*(e*x+d)^n)^3-I*g*Pi*b*f^3*x^2*csgn(I*c*(e*x+d)^n)^3+1/10*I*g^4*Pi*b*x^5*
csgn(I*c)*csgn(I*c*(e*x+d)^n)^2+1/20/e*g^4*b*d*n*x^4-1/4*g^3*b*f*n*x^4+1/5*g^4*ln(c)*b*x^5+ln(c)*b*f^4*x-1/15/
e^2*g^4*b*d^2*n*x^3-2/3*g^2*b*f^2*n*x^3+1/10/e^3*g^4*b*d^3*n*x^2-g*b*f^3*n*x^2-1/5/e^4*g^4*b*d^4*n*x

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 395 vs. \(2 (166) = 332\).
time = 0.28, size = 395, normalized size = 2.22 \begin {gather*} \frac {1}{5} \, b g^{4} x^{5} \log \left ({\left (x e + d\right )}^{n} c\right ) + \frac {1}{5} \, a g^{4} x^{5} + b f g^{3} x^{4} \log \left ({\left (x e + d\right )}^{n} c\right ) + a f g^{3} x^{4} + 2 \, b f^{2} g^{2} x^{3} \log \left ({\left (x e + d\right )}^{n} c\right ) + 2 \, a f^{2} g^{2} x^{3} + {\left (d e^{\left (-2\right )} \log \left (x e + d\right ) - x e^{\left (-1\right )}\right )} b f^{4} n e - {\left (2 \, d^{2} e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x^{2} e - 2 \, d x\right )} e^{\left (-2\right )}\right )} b f^{3} g n e + \frac {1}{3} \, {\left (6 \, d^{3} e^{\left (-4\right )} \log \left (x e + d\right ) - {\left (2 \, x^{3} e^{2} - 3 \, d x^{2} e + 6 \, d^{2} x\right )} e^{\left (-3\right )}\right )} b f^{2} g^{2} n e - \frac {1}{12} \, {\left (12 \, d^{4} e^{\left (-5\right )} \log \left (x e + d\right ) + {\left (3 \, x^{4} e^{3} - 4 \, d x^{3} e^{2} + 6 \, d^{2} x^{2} e - 12 \, d^{3} x\right )} e^{\left (-4\right )}\right )} b f g^{3} n e + \frac {1}{300} \, {\left (60 \, d^{5} e^{\left (-6\right )} \log \left (x e + d\right ) - {\left (12 \, x^{5} e^{4} - 15 \, d x^{4} e^{3} + 20 \, d^{2} x^{3} e^{2} - 30 \, d^{3} x^{2} e + 60 \, d^{4} x\right )} e^{\left (-5\right )}\right )} b g^{4} n e + 2 \, b f^{3} g x^{2} \log \left ({\left (x e + d\right )}^{n} c\right ) + 2 \, a f^{3} g x^{2} + b f^{4} x \log \left ({\left (x e + d\right )}^{n} c\right ) + a f^{4} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)^4*(a+b*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

1/5*b*g^4*x^5*log((x*e + d)^n*c) + 1/5*a*g^4*x^5 + b*f*g^3*x^4*log((x*e + d)^n*c) + a*f*g^3*x^4 + 2*b*f^2*g^2*
x^3*log((x*e + d)^n*c) + 2*a*f^2*g^2*x^3 + (d*e^(-2)*log(x*e + d) - x*e^(-1))*b*f^4*n*e - (2*d^2*e^(-3)*log(x*
e + d) + (x^2*e - 2*d*x)*e^(-2))*b*f^3*g*n*e + 1/3*(6*d^3*e^(-4)*log(x*e + d) - (2*x^3*e^2 - 3*d*x^2*e + 6*d^2
*x)*e^(-3))*b*f^2*g^2*n*e - 1/12*(12*d^4*e^(-5)*log(x*e + d) + (3*x^4*e^3 - 4*d*x^3*e^2 + 6*d^2*x^2*e - 12*d^3
*x)*e^(-4))*b*f*g^3*n*e + 1/300*(60*d^5*e^(-6)*log(x*e + d) - (12*x^5*e^4 - 15*d*x^4*e^3 + 20*d^2*x^3*e^2 - 30
*d^3*x^2*e + 60*d^4*x)*e^(-5))*b*g^4*n*e + 2*b*f^3*g*x^2*log((x*e + d)^n*c) + 2*a*f^3*g*x^2 + b*f^4*x*log((x*e
 + d)^n*c) + a*f^4*x

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 427 vs. \(2 (166) = 332\).
time = 0.42, size = 427, normalized size = 2.40 \begin {gather*} -\frac {1}{300} \, {\left (60 \, b d^{4} g^{4} n x e - 60 \, {\left (b g^{4} x^{5} + 5 \, b f g^{3} x^{4} + 10 \, b f^{2} g^{2} x^{3} + 10 \, b f^{3} g x^{2} + 5 \, b f^{4} x\right )} e^{5} \log \left (c\right ) + {\left (12 \, {\left (b g^{4} n - 5 \, a g^{4}\right )} x^{5} + 75 \, {\left (b f g^{3} n - 4 \, a f g^{3}\right )} x^{4} + 200 \, {\left (b f^{2} g^{2} n - 3 \, a f^{2} g^{2}\right )} x^{3} + 300 \, {\left (b f^{3} g n - 2 \, a f^{3} g\right )} x^{2} + 300 \, {\left (b f^{4} n - a f^{4}\right )} x\right )} e^{5} - 5 \, {\left (3 \, b d g^{4} n x^{4} + 20 \, b d f g^{3} n x^{3} + 60 \, b d f^{2} g^{2} n x^{2} + 120 \, b d f^{3} g n x\right )} e^{4} + 10 \, {\left (2 \, b d^{2} g^{4} n x^{3} + 15 \, b d^{2} f g^{3} n x^{2} + 60 \, b d^{2} f^{2} g^{2} n x\right )} e^{3} - 30 \, {\left (b d^{3} g^{4} n x^{2} + 10 \, b d^{3} f g^{3} n x\right )} e^{2} - 60 \, {\left (b d^{5} g^{4} n - 5 \, b d^{4} f g^{3} n e + 10 \, b d^{3} f^{2} g^{2} n e^{2} - 10 \, b d^{2} f^{3} g n e^{3} + 5 \, b d f^{4} n e^{4} + {\left (b g^{4} n x^{5} + 5 \, b f g^{3} n x^{4} + 10 \, b f^{2} g^{2} n x^{3} + 10 \, b f^{3} g n x^{2} + 5 \, b f^{4} n x\right )} e^{5}\right )} \log \left (x e + d\right )\right )} e^{\left (-5\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)^4*(a+b*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

-1/300*(60*b*d^4*g^4*n*x*e - 60*(b*g^4*x^5 + 5*b*f*g^3*x^4 + 10*b*f^2*g^2*x^3 + 10*b*f^3*g*x^2 + 5*b*f^4*x)*e^
5*log(c) + (12*(b*g^4*n - 5*a*g^4)*x^5 + 75*(b*f*g^3*n - 4*a*f*g^3)*x^4 + 200*(b*f^2*g^2*n - 3*a*f^2*g^2)*x^3
+ 300*(b*f^3*g*n - 2*a*f^3*g)*x^2 + 300*(b*f^4*n - a*f^4)*x)*e^5 - 5*(3*b*d*g^4*n*x^4 + 20*b*d*f*g^3*n*x^3 + 6
0*b*d*f^2*g^2*n*x^2 + 120*b*d*f^3*g*n*x)*e^4 + 10*(2*b*d^2*g^4*n*x^3 + 15*b*d^2*f*g^3*n*x^2 + 60*b*d^2*f^2*g^2
*n*x)*e^3 - 30*(b*d^3*g^4*n*x^2 + 10*b*d^3*f*g^3*n*x)*e^2 - 60*(b*d^5*g^4*n - 5*b*d^4*f*g^3*n*e + 10*b*d^3*f^2
*g^2*n*e^2 - 10*b*d^2*f^3*g*n*e^3 + 5*b*d*f^4*n*e^4 + (b*g^4*n*x^5 + 5*b*f*g^3*n*x^4 + 10*b*f^2*g^2*n*x^3 + 10
*b*f^3*g*n*x^2 + 5*b*f^4*n*x)*e^5)*log(x*e + d))*e^(-5)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 568 vs. \(2 (153) = 306\).
time = 2.45, size = 568, normalized size = 3.19 \begin {gather*} \begin {cases} a f^{4} x + 2 a f^{3} g x^{2} + 2 a f^{2} g^{2} x^{3} + a f g^{3} x^{4} + \frac {a g^{4} x^{5}}{5} + \frac {b d^{5} g^{4} \log {\left (c \left (d + e x\right )^{n} \right )}}{5 e^{5}} - \frac {b d^{4} f g^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{4}} - \frac {b d^{4} g^{4} n x}{5 e^{4}} + \frac {2 b d^{3} f^{2} g^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{3}} + \frac {b d^{3} f g^{3} n x}{e^{3}} + \frac {b d^{3} g^{4} n x^{2}}{10 e^{3}} - \frac {2 b d^{2} f^{3} g \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{2}} - \frac {2 b d^{2} f^{2} g^{2} n x}{e^{2}} - \frac {b d^{2} f g^{3} n x^{2}}{2 e^{2}} - \frac {b d^{2} g^{4} n x^{3}}{15 e^{2}} + \frac {b d f^{4} \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + \frac {2 b d f^{3} g n x}{e} + \frac {b d f^{2} g^{2} n x^{2}}{e} + \frac {b d f g^{3} n x^{3}}{3 e} + \frac {b d g^{4} n x^{4}}{20 e} - b f^{4} n x + b f^{4} x \log {\left (c \left (d + e x\right )^{n} \right )} - b f^{3} g n x^{2} + 2 b f^{3} g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )} - \frac {2 b f^{2} g^{2} n x^{3}}{3} + 2 b f^{2} g^{2} x^{3} \log {\left (c \left (d + e x\right )^{n} \right )} - \frac {b f g^{3} n x^{4}}{4} + b f g^{3} x^{4} \log {\left (c \left (d + e x\right )^{n} \right )} - \frac {b g^{4} n x^{5}}{25} + \frac {b g^{4} x^{5} \log {\left (c \left (d + e x\right )^{n} \right )}}{5} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (f^{4} x + 2 f^{3} g x^{2} + 2 f^{2} g^{2} x^{3} + f g^{3} x^{4} + \frac {g^{4} x^{5}}{5}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)**4*(a+b*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*f**4*x + 2*a*f**3*g*x**2 + 2*a*f**2*g**2*x**3 + a*f*g**3*x**4 + a*g**4*x**5/5 + b*d**5*g**4*log(c
*(d + e*x)**n)/(5*e**5) - b*d**4*f*g**3*log(c*(d + e*x)**n)/e**4 - b*d**4*g**4*n*x/(5*e**4) + 2*b*d**3*f**2*g*
*2*log(c*(d + e*x)**n)/e**3 + b*d**3*f*g**3*n*x/e**3 + b*d**3*g**4*n*x**2/(10*e**3) - 2*b*d**2*f**3*g*log(c*(d
 + e*x)**n)/e**2 - 2*b*d**2*f**2*g**2*n*x/e**2 - b*d**2*f*g**3*n*x**2/(2*e**2) - b*d**2*g**4*n*x**3/(15*e**2)
+ b*d*f**4*log(c*(d + e*x)**n)/e + 2*b*d*f**3*g*n*x/e + b*d*f**2*g**2*n*x**2/e + b*d*f*g**3*n*x**3/(3*e) + b*d
*g**4*n*x**4/(20*e) - b*f**4*n*x + b*f**4*x*log(c*(d + e*x)**n) - b*f**3*g*n*x**2 + 2*b*f**3*g*x**2*log(c*(d +
 e*x)**n) - 2*b*f**2*g**2*n*x**3/3 + 2*b*f**2*g**2*x**3*log(c*(d + e*x)**n) - b*f*g**3*n*x**4/4 + b*f*g**3*x**
4*log(c*(d + e*x)**n) - b*g**4*n*x**5/25 + b*g**4*x**5*log(c*(d + e*x)**n)/5, Ne(e, 0)), ((a + b*log(c*d**n))*
(f**4*x + 2*f**3*g*x**2 + 2*f**2*g**2*x**3 + f*g**3*x**4 + g**4*x**5/5), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1224 vs. \(2 (166) = 332\).
time = 5.84, size = 1224, normalized size = 6.88 \begin {gather*} \frac {1}{5} \, {\left (x e + d\right )}^{5} b g^{4} n e^{\left (-5\right )} \log \left (x e + d\right ) - {\left (x e + d\right )}^{4} b d g^{4} n e^{\left (-5\right )} \log \left (x e + d\right ) + 2 \, {\left (x e + d\right )}^{3} b d^{2} g^{4} n e^{\left (-5\right )} \log \left (x e + d\right ) - 2 \, {\left (x e + d\right )}^{2} b d^{3} g^{4} n e^{\left (-5\right )} \log \left (x e + d\right ) + {\left (x e + d\right )} b d^{4} g^{4} n e^{\left (-5\right )} \log \left (x e + d\right ) - \frac {1}{25} \, {\left (x e + d\right )}^{5} b g^{4} n e^{\left (-5\right )} + \frac {1}{4} \, {\left (x e + d\right )}^{4} b d g^{4} n e^{\left (-5\right )} - \frac {2}{3} \, {\left (x e + d\right )}^{3} b d^{2} g^{4} n e^{\left (-5\right )} + {\left (x e + d\right )}^{2} b d^{3} g^{4} n e^{\left (-5\right )} - {\left (x e + d\right )} b d^{4} g^{4} n e^{\left (-5\right )} + {\left (x e + d\right )}^{4} b f g^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) - 4 \, {\left (x e + d\right )}^{3} b d f g^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) + 6 \, {\left (x e + d\right )}^{2} b d^{2} f g^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) - 4 \, {\left (x e + d\right )} b d^{3} f g^{3} n e^{\left (-4\right )} \log \left (x e + d\right ) + \frac {1}{5} \, {\left (x e + d\right )}^{5} b g^{4} e^{\left (-5\right )} \log \left (c\right ) - {\left (x e + d\right )}^{4} b d g^{4} e^{\left (-5\right )} \log \left (c\right ) + 2 \, {\left (x e + d\right )}^{3} b d^{2} g^{4} e^{\left (-5\right )} \log \left (c\right ) - 2 \, {\left (x e + d\right )}^{2} b d^{3} g^{4} e^{\left (-5\right )} \log \left (c\right ) + {\left (x e + d\right )} b d^{4} g^{4} e^{\left (-5\right )} \log \left (c\right ) - \frac {1}{4} \, {\left (x e + d\right )}^{4} b f g^{3} n e^{\left (-4\right )} + \frac {4}{3} \, {\left (x e + d\right )}^{3} b d f g^{3} n e^{\left (-4\right )} - 3 \, {\left (x e + d\right )}^{2} b d^{2} f g^{3} n e^{\left (-4\right )} + 4 \, {\left (x e + d\right )} b d^{3} f g^{3} n e^{\left (-4\right )} + \frac {1}{5} \, {\left (x e + d\right )}^{5} a g^{4} e^{\left (-5\right )} - {\left (x e + d\right )}^{4} a d g^{4} e^{\left (-5\right )} + 2 \, {\left (x e + d\right )}^{3} a d^{2} g^{4} e^{\left (-5\right )} - 2 \, {\left (x e + d\right )}^{2} a d^{3} g^{4} e^{\left (-5\right )} + {\left (x e + d\right )} a d^{4} g^{4} e^{\left (-5\right )} + 2 \, {\left (x e + d\right )}^{3} b f^{2} g^{2} n e^{\left (-3\right )} \log \left (x e + d\right ) - 6 \, {\left (x e + d\right )}^{2} b d f^{2} g^{2} n e^{\left (-3\right )} \log \left (x e + d\right ) + 6 \, {\left (x e + d\right )} b d^{2} f^{2} g^{2} n e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x e + d\right )}^{4} b f g^{3} e^{\left (-4\right )} \log \left (c\right ) - 4 \, {\left (x e + d\right )}^{3} b d f g^{3} e^{\left (-4\right )} \log \left (c\right ) + 6 \, {\left (x e + d\right )}^{2} b d^{2} f g^{3} e^{\left (-4\right )} \log \left (c\right ) - 4 \, {\left (x e + d\right )} b d^{3} f g^{3} e^{\left (-4\right )} \log \left (c\right ) - \frac {2}{3} \, {\left (x e + d\right )}^{3} b f^{2} g^{2} n e^{\left (-3\right )} + 3 \, {\left (x e + d\right )}^{2} b d f^{2} g^{2} n e^{\left (-3\right )} - 6 \, {\left (x e + d\right )} b d^{2} f^{2} g^{2} n e^{\left (-3\right )} + {\left (x e + d\right )}^{4} a f g^{3} e^{\left (-4\right )} - 4 \, {\left (x e + d\right )}^{3} a d f g^{3} e^{\left (-4\right )} + 6 \, {\left (x e + d\right )}^{2} a d^{2} f g^{3} e^{\left (-4\right )} - 4 \, {\left (x e + d\right )} a d^{3} f g^{3} e^{\left (-4\right )} + 2 \, {\left (x e + d\right )}^{2} b f^{3} g n e^{\left (-2\right )} \log \left (x e + d\right ) - 4 \, {\left (x e + d\right )} b d f^{3} g n e^{\left (-2\right )} \log \left (x e + d\right ) + 2 \, {\left (x e + d\right )}^{3} b f^{2} g^{2} e^{\left (-3\right )} \log \left (c\right ) - 6 \, {\left (x e + d\right )}^{2} b d f^{2} g^{2} e^{\left (-3\right )} \log \left (c\right ) + 6 \, {\left (x e + d\right )} b d^{2} f^{2} g^{2} e^{\left (-3\right )} \log \left (c\right ) - {\left (x e + d\right )}^{2} b f^{3} g n e^{\left (-2\right )} + 4 \, {\left (x e + d\right )} b d f^{3} g n e^{\left (-2\right )} + 2 \, {\left (x e + d\right )}^{3} a f^{2} g^{2} e^{\left (-3\right )} - 6 \, {\left (x e + d\right )}^{2} a d f^{2} g^{2} e^{\left (-3\right )} + 6 \, {\left (x e + d\right )} a d^{2} f^{2} g^{2} e^{\left (-3\right )} + {\left (x e + d\right )} b f^{4} n e^{\left (-1\right )} \log \left (x e + d\right ) + 2 \, {\left (x e + d\right )}^{2} b f^{3} g e^{\left (-2\right )} \log \left (c\right ) - 4 \, {\left (x e + d\right )} b d f^{3} g e^{\left (-2\right )} \log \left (c\right ) - {\left (x e + d\right )} b f^{4} n e^{\left (-1\right )} + 2 \, {\left (x e + d\right )}^{2} a f^{3} g e^{\left (-2\right )} - 4 \, {\left (x e + d\right )} a d f^{3} g e^{\left (-2\right )} + {\left (x e + d\right )} b f^{4} e^{\left (-1\right )} \log \left (c\right ) + {\left (x e + d\right )} a f^{4} e^{\left (-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)^4*(a+b*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

1/5*(x*e + d)^5*b*g^4*n*e^(-5)*log(x*e + d) - (x*e + d)^4*b*d*g^4*n*e^(-5)*log(x*e + d) + 2*(x*e + d)^3*b*d^2*
g^4*n*e^(-5)*log(x*e + d) - 2*(x*e + d)^2*b*d^3*g^4*n*e^(-5)*log(x*e + d) + (x*e + d)*b*d^4*g^4*n*e^(-5)*log(x
*e + d) - 1/25*(x*e + d)^5*b*g^4*n*e^(-5) + 1/4*(x*e + d)^4*b*d*g^4*n*e^(-5) - 2/3*(x*e + d)^3*b*d^2*g^4*n*e^(
-5) + (x*e + d)^2*b*d^3*g^4*n*e^(-5) - (x*e + d)*b*d^4*g^4*n*e^(-5) + (x*e + d)^4*b*f*g^3*n*e^(-4)*log(x*e + d
) - 4*(x*e + d)^3*b*d*f*g^3*n*e^(-4)*log(x*e + d) + 6*(x*e + d)^2*b*d^2*f*g^3*n*e^(-4)*log(x*e + d) - 4*(x*e +
 d)*b*d^3*f*g^3*n*e^(-4)*log(x*e + d) + 1/5*(x*e + d)^5*b*g^4*e^(-5)*log(c) - (x*e + d)^4*b*d*g^4*e^(-5)*log(c
) + 2*(x*e + d)^3*b*d^2*g^4*e^(-5)*log(c) - 2*(x*e + d)^2*b*d^3*g^4*e^(-5)*log(c) + (x*e + d)*b*d^4*g^4*e^(-5)
*log(c) - 1/4*(x*e + d)^4*b*f*g^3*n*e^(-4) + 4/3*(x*e + d)^3*b*d*f*g^3*n*e^(-4) - 3*(x*e + d)^2*b*d^2*f*g^3*n*
e^(-4) + 4*(x*e + d)*b*d^3*f*g^3*n*e^(-4) + 1/5*(x*e + d)^5*a*g^4*e^(-5) - (x*e + d)^4*a*d*g^4*e^(-5) + 2*(x*e
 + d)^3*a*d^2*g^4*e^(-5) - 2*(x*e + d)^2*a*d^3*g^4*e^(-5) + (x*e + d)*a*d^4*g^4*e^(-5) + 2*(x*e + d)^3*b*f^2*g
^2*n*e^(-3)*log(x*e + d) - 6*(x*e + d)^2*b*d*f^2*g^2*n*e^(-3)*log(x*e + d) + 6*(x*e + d)*b*d^2*f^2*g^2*n*e^(-3
)*log(x*e + d) + (x*e + d)^4*b*f*g^3*e^(-4)*log(c) - 4*(x*e + d)^3*b*d*f*g^3*e^(-4)*log(c) + 6*(x*e + d)^2*b*d
^2*f*g^3*e^(-4)*log(c) - 4*(x*e + d)*b*d^3*f*g^3*e^(-4)*log(c) - 2/3*(x*e + d)^3*b*f^2*g^2*n*e^(-3) + 3*(x*e +
 d)^2*b*d*f^2*g^2*n*e^(-3) - 6*(x*e + d)*b*d^2*f^2*g^2*n*e^(-3) + (x*e + d)^4*a*f*g^3*e^(-4) - 4*(x*e + d)^3*a
*d*f*g^3*e^(-4) + 6*(x*e + d)^2*a*d^2*f*g^3*e^(-4) - 4*(x*e + d)*a*d^3*f*g^3*e^(-4) + 2*(x*e + d)^2*b*f^3*g*n*
e^(-2)*log(x*e + d) - 4*(x*e + d)*b*d*f^3*g*n*e^(-2)*log(x*e + d) + 2*(x*e + d)^3*b*f^2*g^2*e^(-3)*log(c) - 6*
(x*e + d)^2*b*d*f^2*g^2*e^(-3)*log(c) + 6*(x*e + d)*b*d^2*f^2*g^2*e^(-3)*log(c) - (x*e + d)^2*b*f^3*g*n*e^(-2)
 + 4*(x*e + d)*b*d*f^3*g*n*e^(-2) + 2*(x*e + d)^3*a*f^2*g^2*e^(-3) - 6*(x*e + d)^2*a*d*f^2*g^2*e^(-3) + 6*(x*e
 + d)*a*d^2*f^2*g^2*e^(-3) + (x*e + d)*b*f^4*n*e^(-1)*log(x*e + d) + 2*(x*e + d)^2*b*f^3*g*e^(-2)*log(c) - 4*(
x*e + d)*b*d*f^3*g*e^(-2)*log(c) - (x*e + d)*b*f^4*n*e^(-1) + 2*(x*e + d)^2*a*f^3*g*e^(-2) - 4*(x*e + d)*a*d*f
^3*g*e^(-2) + (x*e + d)*b*f^4*e^(-1)*log(c) + (x*e + d)*a*f^4*e^(-1)

________________________________________________________________________________________

Mupad [B]
time = 0.42, size = 526, normalized size = 2.96 \begin {gather*} x\,\left (\frac {5\,a\,e\,f^4+20\,a\,d\,f^3\,g-5\,b\,e\,f^4\,n}{5\,e}-\frac {d\,\left (\frac {d\,\left (\frac {d\,\left (\frac {g^3\,\left (a\,d\,g+4\,a\,e\,f-b\,e\,f\,n\right )}{e}-\frac {d\,g^4\,\left (5\,a-b\,n\right )}{5\,e}\right )}{e}-\frac {2\,f\,g^2\,\left (2\,a\,d\,g+3\,a\,e\,f-b\,e\,f\,n\right )}{e}\right )}{e}+\frac {2\,f^2\,g\,\left (3\,a\,d\,g+2\,a\,e\,f-b\,e\,f\,n\right )}{e}\right )}{e}\right )-x^3\,\left (\frac {d\,\left (\frac {g^3\,\left (a\,d\,g+4\,a\,e\,f-b\,e\,f\,n\right )}{e}-\frac {d\,g^4\,\left (5\,a-b\,n\right )}{5\,e}\right )}{3\,e}-\frac {2\,f\,g^2\,\left (2\,a\,d\,g+3\,a\,e\,f-b\,e\,f\,n\right )}{3\,e}\right )+x^4\,\left (\frac {g^3\,\left (a\,d\,g+4\,a\,e\,f-b\,e\,f\,n\right )}{4\,e}-\frac {d\,g^4\,\left (5\,a-b\,n\right )}{20\,e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (b\,f^4\,x+2\,b\,f^3\,g\,x^2+2\,b\,f^2\,g^2\,x^3+b\,f\,g^3\,x^4+\frac {b\,g^4\,x^5}{5}\right )+x^2\,\left (\frac {d\,\left (\frac {d\,\left (\frac {g^3\,\left (a\,d\,g+4\,a\,e\,f-b\,e\,f\,n\right )}{e}-\frac {d\,g^4\,\left (5\,a-b\,n\right )}{5\,e}\right )}{e}-\frac {2\,f\,g^2\,\left (2\,a\,d\,g+3\,a\,e\,f-b\,e\,f\,n\right )}{e}\right )}{2\,e}+\frac {f^2\,g\,\left (3\,a\,d\,g+2\,a\,e\,f-b\,e\,f\,n\right )}{e}\right )+\frac {g^4\,x^5\,\left (5\,a-b\,n\right )}{25}+\frac {\ln \left (d+e\,x\right )\,\left (b\,n\,d^5\,g^4-5\,b\,n\,d^4\,e\,f\,g^3+10\,b\,n\,d^3\,e^2\,f^2\,g^2-10\,b\,n\,d^2\,e^3\,f^3\,g+5\,b\,n\,d\,e^4\,f^4\right )}{5\,e^5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f + g*x)^4*(a + b*log(c*(d + e*x)^n)),x)

[Out]

x*((5*a*e*f^4 + 20*a*d*f^3*g - 5*b*e*f^4*n)/(5*e) - (d*((d*((d*((g^3*(a*d*g + 4*a*e*f - b*e*f*n))/e - (d*g^4*(
5*a - b*n))/(5*e)))/e - (2*f*g^2*(2*a*d*g + 3*a*e*f - b*e*f*n))/e))/e + (2*f^2*g*(3*a*d*g + 2*a*e*f - b*e*f*n)
)/e))/e) - x^3*((d*((g^3*(a*d*g + 4*a*e*f - b*e*f*n))/e - (d*g^4*(5*a - b*n))/(5*e)))/(3*e) - (2*f*g^2*(2*a*d*
g + 3*a*e*f - b*e*f*n))/(3*e)) + x^4*((g^3*(a*d*g + 4*a*e*f - b*e*f*n))/(4*e) - (d*g^4*(5*a - b*n))/(20*e)) +
log(c*(d + e*x)^n)*((b*g^4*x^5)/5 + b*f^4*x + 2*b*f^2*g^2*x^3 + 2*b*f^3*g*x^2 + b*f*g^3*x^4) + x^2*((d*((d*((g
^3*(a*d*g + 4*a*e*f - b*e*f*n))/e - (d*g^4*(5*a - b*n))/(5*e)))/e - (2*f*g^2*(2*a*d*g + 3*a*e*f - b*e*f*n))/e)
)/(2*e) + (f^2*g*(3*a*d*g + 2*a*e*f - b*e*f*n))/e) + (g^4*x^5*(5*a - b*n))/25 + (log(d + e*x)*(b*d^5*g^4*n + 5
*b*d*e^4*f^4*n + 10*b*d^3*e^2*f^2*g^2*n - 5*b*d^4*e*f*g^3*n - 10*b*d^2*e^3*f^3*g*n))/(5*e^5)

________________________________________________________________________________________